package com.munichosica.myapp.controller;

import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

import com.munichosica.myapp.dto.Usuario;

@Controller
@RequestMapping("/")
public class UsuarioController{
	
	@RequestMapping(value="Registrarse.jf", method=RequestMethod.GET)
	public String registrarse(Model model){
		System.out.println("INGRESO A REGISTRARSE");
		return "tilesLogin";
	}
	
	@RequestMapping(value="FalloLogin.jf", method=RequestMethod.GET)
	public String falloLogin(Usuario usuario,Model model){
		model.addAttribute("error", usuario.getUsuario()+"Usted no pudo registrarse intentelo nuevamente");
		return "tilesLogin";
	}

	@RequestMapping(value="Salir.jf", method=RequestMethod.GET)
	public String salir(Model model){
		return "tilesLogoff";	
	}
	
	@RequestMapping(value="Index.jf", method=RequestMethod.GET)
	public String bienvenido(Model model){
		return "tilesBienvenido";
	}
	
	@RequestMapping(value="403.jf", method=RequestMethod.GET)
	public String error403(Model model){
		return "tiles403";
	}
}
